<%@page import="java.util.ArrayList"%>
<%@page import="blog.forms.Blog"%>
<%@page import="org.blog.logic.UserLogic"%>
<%@page import="org.blog.logic.BlogLogic"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="ISO-8859-1" %>
<%@ page errorPage="../jsp/exceptionHandler.jsp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<jsp:include page="cssChoose.jsp" />

<title><%= "Wszytskie blogi" %></title>
</head>
<body>

 	<div id = "container"> 	
 	 		
 	<jsp:include page="header.jsp">
 		<jsp:param value="Blog-przeglad" name="title"/>
 	</jsp:include>
 	 		<div id="texts">
	<jsp:include page="menu.jsp"/>	
		
		<div id = "content">
		
			<% ArrayList<Blog> blogs = (ArrayList<Blog>)BlogLogic.getInstance().getBlogs(); 

			int i = 0;
			for(Blog b : blogs) {
				if(UserLogic.getInstance().getUser(b.getUserId()) != null) {
			%>
			<a href = "BlogServlet?do=view&id=<%=b.getId()%>"><%=++i +". "+ b.getName()
			+"("+b.getEntries().size()+")" +"   -"+UserLogic.getInstance().getUser(b.getUserId()).getLogin()+""%></a><br/>
			<% }
			} %>
			
		</div>
		
	</div>
		<jsp:include page="../html/footer.html"/>
						

	</div>
	
</body>
</html>